//using SqlSugar;
//using System;
//using System.Linq.Expressions;
//using System.Threading;
//using System.Threading.Tasks;

//namespace OrmTest
//{
//    /// <summary>
//    /// UTIL CONVERT TEST SUITE - Comprehensive Testing for SqlSugar Utility Conversion Methods
//    /// 
//    /// PURPOSE:
//    ///   Validates all utility conversion extension methods used throughout SqlSugar ORM
//    ///   Ensures type safety, null handling, and edge case coverage for data conversions
//    /// 
//    /// COVERAGE: 52 test functions across 11 categories
//    ///   - Type conversions: int, long, decimal, money, date, bool, string
//    ///   - Null/DBNull safety validation
//    ///   - Default value fallback mechanisms
//    ///   - Culture-specific formatting
//    ///   - Thread safety and performance
//    /// 
//    /// USAGE: NewUnitTest.UtilConvert();
//    /// </summary>
//    public partial class NewUnitTest
//    {
//        #region Main Entry Point

//        /// <summary>
//        /// Main test runner - executes all 52 utility conversion tests
//        /// Tests are organized by conversion type and displayed with progress indicators
//        /// </summary>
//        public static void UtilConvert()
//        {
//            Console.WriteLine("\n================================================================");
//            Console.WriteLine("       UTIL CONVERT TEST SUITE - COMPREHENSIVE (52 TESTS)");
//            Console.WriteLine("================================================================\n");

//            // A. ObjToInt Tests (6 functions)
//            Console.WriteLine("--- ObjToInt TESTS ---");
//            ObjToInt_ValidInteger();
//            ObjToInt_NullValue();
//            ObjToInt_DBNullValue();
//            ObjToInt_EnumValue();
//            ObjToInt_InvalidFormat();
//            ObjToInt_WithDefaultValue();

//            // B. ObjToLong Tests (5 functions)
//            Console.WriteLine("\n--- ObjToLong TESTS ---");
//            ObjToLong_ValidLong();
//            ObjToLong_NullValues();
//            ObjToLong_EnumValue();
//            ObjToLong_Overflow();
//            ObjToLong_InvalidFormat();

//            // C. ObjToMoney Tests (4 functions)
//            Console.WriteLine("\n--- ObjToMoney TESTS ---");
//            ObjToMoney_ValidMoney();
//            ObjToMoney_NullValues();
//            ObjToMoney_WithDefaultValue();
//            ObjToMoney_CurrencyFormats();

//            // D. ObjToDecimal Tests (5 functions)
//            Console.WriteLine("\n--- ObjToDecimal TESTS ---");
//            ObjToDecimal_ValidDecimal();
//            ObjToDecimal_NullValues();
//            ObjToDecimal_WithDefaultValue();
//            ObjToDecimal_Precision();
//            ObjToDecimal_Overflow();

//            // E. ObjToDate Tests (6 functions)
//            Console.WriteLine("\n--- ObjToDate TESTS ---");
//            ObjToDate_ValidDate();
//            ObjToDate_NullValues();
//            ObjToDate_WithDefaultValue();
//            ObjToDate_DateFormats();
//            ObjToDate_EdgeDates();
//            ObjToDate_InvalidDate();

//            // F. ObjToBool Tests (4 functions)
//            Console.WriteLine("\n--- ObjToBool TESTS ---");
//            ObjToBool_ValidBool();
//            ObjToBool_NullValues();
//            ObjToBool_NumericValues();
//            ObjToBool_InvalidValues();

//            // G. ObjToString Tests (6 functions)
//            Console.WriteLine("\n--- ObjToString TESTS ---");
//            ObjToString_ValidString();
//            ObjToString_NullValue();
//            ObjToString_Whitespace();
//            ObjToString_NoTrim();
//            ObjToString_WithDefaultValue();
//            ObjToString_DateTimeFormatter();

//            // H. ObjToStringNew Tests (4 functions)
//            Console.WriteLine("\n--- ObjToStringNew TESTS ---");
//            ObjToStringNew_ByteArray();
//            ObjToStringNew_DateOnly();
//            ObjToStringNew_NormalValues();
//            ObjToStringNew_NullValue();

//            // I. EqualCase Tests (4 functions)
//            Console.WriteLine("\n--- EqualCase TESTS ---");
//            EqualCase_SameCase();
//            EqualCase_DifferentCase();
//            EqualCase_NullValues();
//            EqualCase_SpecialCharacters();

//            // J. ToMemberExpression Tests (3 functions)
//            Console.WriteLine("\n--- ToMemberExpression TESTS ---");
//            ToMemberExpression_UnaryExpression();
//            ToMemberExpression_DirectMember();
//            ToMemberExpression_InvalidExpression();

//            // K. Edge Cases & Cultural Tests (5 functions)
//            Console.WriteLine("\n--- EDGE CASES & CULTURAL TESTS ---");
//            Cultural_NumberFormats();
//            Cultural_DateFormats();
//            EdgeCase_ThreadSafety();
//            EdgeCase_ExtremeValues();
//            EdgeCase_Performance();

//            Console.WriteLine("\n================================================================");
//            Console.WriteLine("            ALL UTIL CONVERT TESTS PASSED (52/52)");
//            Console.WriteLine("================================================================\n");
//        }

//        #endregion

//        #region A. ObjToInt Tests (6 functions)
//        // Tests object-to-integer conversion with various input types and edge cases

//        /// <summary>
//        /// Validates conversion of valid inputs to integers
//        /// Tests: string numbers, int passthrough, zero, negative values
//        /// </summary>
//        public static void ObjToInt_ValidInteger()
//        {
//            Check.Exception("123".ObjToInt() == 123, "ObjToInt: '123' -> 123");
//            Check.Exception(((object)456).ObjToInt() == 456, "ObjToInt: 456 -> 456");
//            Check.Exception("0".ObjToInt() == 0, "ObjToInt: '0' -> 0");
//            Check.Exception("-789".ObjToInt() == -789, "ObjToInt: '-789' -> -789");
//            Console.WriteLine("✓ ObjToInt_ValidInteger passed");
//        }

//        /// <summary>
//        /// Validates null input returns 0 (safe default behavior)
//        /// </summary>
//        public static void ObjToInt_NullValue()
//        {
//            object value = null;
//            Check.Exception(value.ObjToInt() == 0, "ObjToInt: null -> 0");
//            Console.WriteLine("✓ ObjToInt_NullValue passed");
//        }

//        /// <summary>
//        /// Validates DBNull.Value returns 0 (database null safety)
//        /// </summary>
//        public static void ObjToInt_DBNullValue()
//        {
//            Check.Exception(DBNull.Value.ObjToInt() == 0, "ObjToInt: DBNull -> 0");
//            Console.WriteLine("✓ ObjToInt_DBNullValue passed");
//        }

//        /// <summary>
//        /// Validates enum values convert to their underlying integer representation
//        /// Tests: DayOfWeek enum (Monday=1, Sunday=0, Saturday=6)
//        /// </summary>
//        public static void ObjToInt_EnumValue()
//        {
//            Check.Exception(((object)DayOfWeek.Monday).ObjToInt() == 1, "ObjToInt: DayOfWeek.Monday -> 1");
//            Check.Exception(((object)DayOfWeek.Sunday).ObjToInt() == 0, "ObjToInt: DayOfWeek.Sunday -> 0");
//            Check.Exception(((object)DayOfWeek.Saturday).ObjToInt() == 6, "ObjToInt: DayOfWeek.Saturday -> 6");
//            Console.WriteLine("✓ ObjToInt_EnumValue passed");
//        }

//        /// <summary>
//        /// Validates invalid inputs return 0 (graceful failure)
//        /// Tests: non-numeric strings, decimal strings, whitespace
//        /// </summary>
//        public static void ObjToInt_InvalidFormat()
//        {
//            Check.Exception("abc".ObjToInt() == 0, "ObjToInt: 'abc' -> 0");
//            Check.Exception("12.5".ObjToInt() == 0, "ObjToInt: '12.5' -> 0");
//            Check.Exception("  ".ObjToInt() == 0, "ObjToInt: whitespace -> 0");
//            Console.WriteLine("✓ ObjToInt_InvalidFormat passed");
//        }

//        /// <summary>
//        /// Validates custom default value is used when conversion fails
//        /// Tests: null with default, invalid string with default, valid value ignores default
//        /// </summary>
//        public static void ObjToInt_WithDefaultValue()
//        {
//            object nullVal = null;
//            Check.Exception(nullVal.ObjToInt(-1) == -1, "ObjToInt: null with default -1 -> -1");
//            Check.Exception("invalid".ObjToInt(999) == 999, "ObjToInt: 'invalid' with default 999 -> 999");
//            Check.Exception("123".ObjToInt(-1) == 123, "ObjToInt: '123' with default -1 -> 123");
//            Console.WriteLine("✓ ObjToInt_WithDefaultValue passed");
//        }

//        #endregion

//        #region B. ObjToLong Tests (5 functions)
//        // Tests object-to-long conversion for large numbers and 64-bit integers

//        /// <summary>
//        /// Validates conversion of large numbers to long (Int64)
//        /// Tests: large number strings, Int64.MaxValue, negative longs
//        /// </summary>
//        public static void ObjToLong_ValidLong()
//        {
//            Check.Exception("123456789".ObjToLong() == 123456789L, "ObjToLong: '123456789' -> 123456789L");
//            Check.Exception(long.MaxValue.ToString().ObjToLong() == long.MaxValue, "ObjToLong: MaxValue string");
//            Check.Exception("-987654321".ObjToLong() == -987654321L, "ObjToLong: negative long");
//            Console.WriteLine("✓ ObjToLong_ValidLong passed");
//        }

//        // Test null and DBNull return 0L
//        public static void ObjToLong_NullValues()
//        {
//            object nullVal = null;
//            Check.Exception(nullVal.ObjToLong() == 0L, "ObjToLong: null -> 0L");
//            Check.Exception(DBNull.Value.ObjToLong() == 0L, "ObjToLong: DBNull -> 0L");
//            Console.WriteLine("✓ ObjToLong_NullValues passed");
//        }

//        // Test enum to long conversion
//        public static void ObjToLong_EnumValue()
//        {
//            Check.Exception(((object)DayOfWeek.Friday).ObjToLong() == 5L, "ObjToLong: DayOfWeek.Friday -> 5L");
//            Check.Exception(((object)DayOfWeek.Wednesday).ObjToLong() == 3L, "ObjToLong: DayOfWeek.Wednesday -> 3L");
//            Console.WriteLine("✓ ObjToLong_EnumValue passed");
//        }

//        // Test extreme values
//        public static void ObjToLong_Overflow()
//        {
//            Check.Exception(((object)long.MaxValue).ObjToLong() == long.MaxValue, "ObjToLong: long.MaxValue");
//            Check.Exception(((object)long.MinValue).ObjToLong() == long.MinValue, "ObjToLong: long.MinValue");
//            Console.WriteLine("✓ ObjToLong_Overflow passed");
//        }

//        // Test invalid format returns 0L
//        public static void ObjToLong_InvalidFormat()
//        {
//            Check.Exception("not a number".ObjToLong() == 0L, "ObjToLong: invalid -> 0L");
//            Check.Exception("12.5".ObjToLong() == 0L, "ObjToLong: decimal string -> 0L");
//            Console.WriteLine("✓ ObjToLong_InvalidFormat passed");
//        }

//        #endregion

//        #region C. ObjToMoney Tests (4 functions)

//        // Test valid money (double) conversion
//        public static void ObjToMoney_ValidMoney()
//        {
//            Check.Exception("123.45".ObjToMoney() == 123.45, "ObjToMoney: '123.45' -> 123.45");
//            Check.Exception("1000.00".ObjToMoney() == 1000.00, "ObjToMoney: '1000.00' -> 1000.00");
//            Check.Exception("-50.99".ObjToMoney() == -50.99, "ObjToMoney: negative amount");
//            Console.WriteLine("✓ ObjToMoney_ValidMoney passed");
//        }

//        // Test null and DBNull return 0.0
//        public static void ObjToMoney_NullValues()
//        {
//            object nullVal = null;
//            Check.Exception(nullVal.ObjToMoney() == 0.0, "ObjToMoney: null -> 0.0");
//            Check.Exception(DBNull.Value.ObjToMoney() == 0.0, "ObjToMoney: DBNull -> 0.0");
//            Console.WriteLine("✓ ObjToMoney_NullValues passed");
//        }

//        // Test with custom default value
//        public static void ObjToMoney_WithDefaultValue()
//        {
//            object nullVal = null;
//            Check.Exception(nullVal.ObjToMoney(99.99) == 99.99, "ObjToMoney: null with default 99.99");
//            Check.Exception("invalid".ObjToMoney(-1.0) == -1.0, "ObjToMoney: invalid with default -1.0");
//            Check.Exception("50.50".ObjToMoney(99.99) == 50.50, "ObjToMoney: valid ignores default");
//            Console.WriteLine("✓ ObjToMoney_WithDefaultValue passed");
//        }

//        // Test currency format handling
//        public static void ObjToMoney_CurrencyFormats()
//        {
//            Check.Exception("1234.56".ObjToMoney() == 1234.56, "ObjToMoney: standard decimal");
//            Check.Exception("0.99".ObjToMoney() == 0.99, "ObjToMoney: leading zero");
//            // Note: Currency symbols like "$1,234.56" are culture-dependent
//            Console.WriteLine("✓ ObjToMoney_CurrencyFormats passed");
//        }

//        #endregion

//        #region D. ObjToDecimal Tests (5 functions)

//        // Test valid decimal conversion with high precision
//        public static void ObjToDecimal_ValidDecimal()
//        {
//            Check.Exception("123.456".ObjToDecimal() == 123.456m, "ObjToDecimal: '123.456' -> 123.456m");
//            Check.Exception("0.001".ObjToDecimal() == 0.001m, "ObjToDecimal: small decimal");
//            Check.Exception(((object)999.999m).ObjToDecimal() == 999.999m, "ObjToDecimal: decimal passthrough");
//            Console.WriteLine("✓ ObjToDecimal_ValidDecimal passed");
//        }

//        // Test null and DBNull return 0m
//        public static void ObjToDecimal_NullValues()
//        {
//            object nullVal = null;
//            Check.Exception(nullVal.ObjToDecimal() == 0m, "ObjToDecimal: null -> 0m");
//            Check.Exception(DBNull.Value.ObjToDecimal() == 0m, "ObjToDecimal: DBNull -> 0m");
//            Console.WriteLine("✓ ObjToDecimal_NullValues passed");
//        }

//        // Test with custom default value
//        public static void ObjToDecimal_WithDefaultValue()
//        {
//            object nullVal = null;
//            Check.Exception(nullVal.ObjToDecimal(99.99m) == 99.99m, "ObjToDecimal: null with default");
//            Check.Exception("invalid".ObjToDecimal(-1.5m) == -1.5m, "ObjToDecimal: invalid with default");
//            Console.WriteLine("✓ ObjToDecimal_WithDefaultValue passed");
//        }

//        // Test high precision decimal values
//        public static void ObjToDecimal_Precision()
//        {
//            Check.Exception("123.456789012345".ObjToDecimal() == 123.456789012345m, "ObjToDecimal: high precision");
//            Check.Exception("0.000000001".ObjToDecimal() == 0.000000001m, "ObjToDecimal: very small decimal");
//            Console.WriteLine("✓ ObjToDecimal_Precision passed");
//        }

//        // Test extreme values
//        public static void ObjToDecimal_Overflow()
//        {
//            Check.Exception(((object)decimal.MaxValue).ObjToDecimal() == decimal.MaxValue, "ObjToDecimal: MaxValue");
//            Check.Exception(((object)decimal.MinValue).ObjToDecimal() == decimal.MinValue, "ObjToDecimal: MinValue");
//            Console.WriteLine("✓ ObjToDecimal_Overflow passed");
//        }

//        #endregion

//        #region E. ObjToDate Tests (6 functions)

//        // Test valid date conversion from various formats
//        public static void ObjToDate_ValidDate()
//        {
//            Check.Exception("2024-01-15".ObjToDate() == new DateTime(2024, 1, 15), "ObjToDate: ISO format");
//            var expectedDate = new DateTime(2024, 6, 30);
//            Check.Exception(((object)expectedDate).ObjToDate() == expectedDate, "ObjToDate: DateTime passthrough");
//            var result = "1/15/2024".ObjToDate();
//            Check.Exception(result.Year == 2024 && result.Month == 1, "ObjToDate: US format");
//            Console.WriteLine("✓ ObjToDate_ValidDate passed");
//        }

//        // Test null and DBNull return DateTime.MinValue
//        public static void ObjToDate_NullValues()
//        {
//            object nullVal = null;
//            Check.Exception(nullVal.ObjToDate() == DateTime.MinValue, "ObjToDate: null -> DateTime.MinValue");
//            Check.Exception(DBNull.Value.ObjToDate() == DateTime.MinValue, "ObjToDate: DBNull -> DateTime.MinValue");
//            Console.WriteLine("✓ ObjToDate_NullValues passed");
//        }

//        // Test with custom default value
//        public static void ObjToDate_WithDefaultValue()
//        {
//            var defaultDate = new DateTime(2000, 1, 1);
//            object nullVal = null;
//            Check.Exception(nullVal.ObjToDate(defaultDate) == defaultDate, "ObjToDate: null with default");
//            Check.Exception("invalid".ObjToDate(defaultDate) == defaultDate, "ObjToDate: invalid with default");
//            Console.WriteLine("✓ ObjToDate_WithDefaultValue passed");
//        }

//        // Test various date format parsing
//        public static void ObjToDate_DateFormats()
//        {
//            Check.Exception("2024-01-15".ObjToDate().Year == 2024, "ObjToDate: ISO format parsing");
//            Check.Exception("01/15/2024".ObjToDate().Year == 2024, "ObjToDate: short date format");
//            var result = "2024-01-15 10:30:00".ObjToDate();
//            Check.Exception(result.Year == 2024 && result.Hour == 10, "ObjToDate: date with time");
//            Console.WriteLine("✓ ObjToDate_DateFormats passed");
//        }

//        // Test edge dates (min/max values)
//        public static void ObjToDate_EdgeDates()
//        {
//            Check.Exception(((object)DateTime.MinValue).ObjToDate() == DateTime.MinValue, "ObjToDate: DateTime.MinValue");
//            Check.Exception(((object)DateTime.MaxValue).ObjToDate() == DateTime.MaxValue, "ObjToDate: DateTime.MaxValue");
//            Check.Exception("0001-01-01".ObjToDate().Year == 1, "ObjToDate: earliest date");
//            Console.WriteLine("✓ ObjToDate_EdgeDates passed");
//        }

//        // Test invalid date returns DateTime.MinValue
//        public static void ObjToDate_InvalidDate()
//        {
//            Check.Exception("not a date".ObjToDate() == DateTime.MinValue, "ObjToDate: invalid string");
//            Check.Exception("2024-13-40".ObjToDate() == DateTime.MinValue, "ObjToDate: invalid date values");
//            Console.WriteLine("✓ ObjToDate_InvalidDate passed");
//        }

//        #endregion

//        #region F. ObjToBool Tests (4 functions)

//        // Test valid boolean conversion
//        public static void ObjToBool_ValidBool()
//        {
//            Check.Exception("true".ObjToBool() == true, "ObjToBool: 'true' -> true");
//            Check.Exception("false".ObjToBool() == false, "ObjToBool: 'false' -> false");
//            Check.Exception("True".ObjToBool() == true, "ObjToBool: case insensitive");
//            Check.Exception(((object)true).ObjToBool() == true, "ObjToBool: bool passthrough");
//            Console.WriteLine("✓ ObjToBool_ValidBool passed");
//        }

//        // Test null and DBNull return false
//        public static void ObjToBool_NullValues()
//        {
//            object nullVal = null;
//            Check.Exception(nullVal.ObjToBool() == false, "ObjToBool: null -> false");
//            Check.Exception(DBNull.Value.ObjToBool() == false, "ObjToBool: DBNull -> false");
//            Console.WriteLine("✓ ObjToBool_NullValues passed");
//        }

//        // Test numeric strings are not converted (TryParse fails)
//        public static void ObjToBool_NumericValues()
//        {
//            Check.Exception("1".ObjToBool() == false, "ObjToBool: '1' -> false (not valid bool)");
//            Check.Exception("0".ObjToBool() == false, "ObjToBool: '0' -> false (not valid bool)");
//            Console.WriteLine("✓ ObjToBool_NumericValues passed");
//        }

//        // Test invalid values return false
//        public static void ObjToBool_InvalidValues()
//        {
//            Check.Exception("yes".ObjToBool() == false, "ObjToBool: 'yes' -> false");
//            Check.Exception("no".ObjToBool() == false, "ObjToBool: 'no' -> false");
//            Check.Exception("Y".ObjToBool() == false, "ObjToBool: 'Y' -> false");
//            Console.WriteLine("✓ ObjToBool_InvalidValues passed");
//        }

//        #endregion

//        #region G. ObjToString Tests (6 functions)

//        // Test valid string conversion
//        public static void ObjToString_ValidString()
//        {
//            Check.Exception("hello".ObjToString() == "hello", "ObjToString: string passthrough");
//            Check.Exception(((object)123).ObjToString() == "123", "ObjToString: int to string");
//            var dt = new DateTime(2024, 1, 15);
//            Check.Exception(((object)dt).ObjToString().Length > 0, "ObjToString: DateTime to string");
//            Console.WriteLine("✓ ObjToString_ValidString passed");
//        }

//        // Test null returns empty string
//        public static void ObjToString_NullValue()
//        {
//            object nullVal = null;
//            Check.Exception(nullVal.ObjToString() == "", "ObjToString: null -> empty string");
//            Console.WriteLine("✓ ObjToString_NullValue passed");
//        }

//        // Test whitespace trimming
//        public static void ObjToString_Whitespace()
//        {
//            Check.Exception("  hello  ".ObjToString() == "hello", "ObjToString: trims whitespace");
//            Check.Exception("   ".ObjToString() == "", "ObjToString: whitespace only -> empty");
//            Console.WriteLine("✓ ObjToString_Whitespace passed");
//        }

//        // Test ObjToStringNoTrim preserves whitespace
//        public static void ObjToString_NoTrim()
//        {
//            Check.Exception("  hello  ".ObjToStringNoTrim() == "  hello  ", "ObjToStringNoTrim: preserves whitespace");
//            object nullVal = null;
//            Check.Exception(nullVal.ObjToStringNoTrim() == "", "ObjToStringNoTrim: null -> empty");
//            Console.WriteLine("✓ ObjToString_NoTrim passed");
//        }

//        // Test with custom default value
//        public static void ObjToString_WithDefaultValue()
//        {
//            object nullVal = null;
//            Check.Exception(nullVal.ObjToString("default") == "default", "ObjToString: null with default");
//            Check.Exception("test".ObjToString("default") == "test", "ObjToString: valid ignores default");
//            Console.WriteLine("✓ ObjToString_WithDefaultValue passed");
//        }

//        // Test DateTime formatter function
//        public static void ObjToString_DateTimeFormatter()
//        {
//            var dt = new DateTime(2024, 1, 15);
//            var result = ((object)dt).ObjToString(d => d.ToString("yyyy-MM-dd"));
//            Check.Exception(result == "2024-01-15", "ObjToString: DateTime with custom formatter");
//            Check.Exception(((object)"text").ObjToString(d => "ignored") == "text", "ObjToString: non-DateTime ignores formatter");
//            Console.WriteLine("✓ ObjToString_DateTimeFormatter passed");
//        }

//        #endregion

//        #region H. ObjToStringNew Tests (4 functions)

//        // Test byte array conversion to pipe-delimited string
//        public static void ObjToStringNew_ByteArray()
//        {
//            byte[] bytes = new byte[] { 1, 2, 3 };
//            Check.Exception(((object)bytes).ObjToStringNew() == "1|2|3", "ObjToStringNew: byte array -> pipe-delimited");
//            byte[] empty = new byte[] { };
//            Check.Exception(((object)empty).ObjToStringNew() == "", "ObjToStringNew: empty byte array");
//            Console.WriteLine("✓ ObjToStringNew_ByteArray passed");
//        }

//        // Test DateOnly type conversion (if available in runtime)
//        public static void ObjToStringNew_DateOnly()
//        {
//            // DateOnly is .NET 6+ type, test with DateTime as fallback
//            var dt = new DateTime(2024, 1, 15);
//            var result = ((object)dt).ObjToStringNew();
//            Check.Exception(result.Length > 0, "ObjToStringNew: DateTime conversion");
//            Console.WriteLine("✓ ObjToStringNew_DateOnly passed");
//        }

//        // Test normal values behave like ObjToString
//        public static void ObjToStringNew_NormalValues()
//        {
//            Check.Exception("hello".ObjToStringNew() == "hello", "ObjToStringNew: string");
//            Check.Exception(((object)123).ObjToStringNew() == "123", "ObjToStringNew: int");
//            Console.WriteLine("✓ ObjToStringNew_NormalValues passed");
//        }

//        // Test null returns empty string
//        public static void ObjToStringNew_NullValue()
//        {
//            object nullVal = null;
//            Check.Exception(nullVal.ObjToStringNew() == "", "ObjToStringNew: null -> empty");
//            Console.WriteLine("✓ ObjToStringNew_NullValue passed");
//        }

//        #endregion

//        #region I. EqualCase Tests (4 functions)

//        // Test case-insensitive equality with same case
//        public static void EqualCase_SameCase()
//        {
//            Check.Exception("hello".EqualCase("hello") == true, "EqualCase: same case equal");
//            Check.Exception("HELLO".EqualCase("HELLO") == true, "EqualCase: same uppercase equal");
//            Console.WriteLine("✓ EqualCase_SameCase passed");
//        }

//        // Test case-insensitive equality with different cases
//        public static void EqualCase_DifferentCase()
//        {
//            Check.Exception("hello".EqualCase("HELLO") == true, "EqualCase: different case equal");
//            Check.Exception("HeLLo".EqualCase("hELLO") == true, "EqualCase: mixed case equal");
//            Check.Exception("test".EqualCase("TEST") == true, "EqualCase: case insensitive");
//            Console.WriteLine("✓ EqualCase_DifferentCase passed");
//        }

//        // Test null value handling
//        public static void EqualCase_NullValues()
//        {
//            Check.Exception("hello".EqualCase(null) == false, "EqualCase: string vs null");
//            string nullStr = null;
//            Check.Exception(nullStr.EqualCase("hello") == false, "EqualCase: null vs string");
//            Check.Exception(nullStr.EqualCase(null) == true, "EqualCase: null vs null");
//            Console.WriteLine("✓ EqualCase_NullValues passed");
//        }

//        // Test with special characters
//        public static void EqualCase_SpecialCharacters()
//        {
//            Check.Exception("hello!".EqualCase("HELLO!") == true, "EqualCase: with punctuation");
//            Check.Exception("hello world".EqualCase("HELLO WORLD") == true, "EqualCase: with spaces");
//            Check.Exception("test123".EqualCase("TEST123") == true, "EqualCase: with numbers");
//            Console.WriteLine("✓ EqualCase_SpecialCharacters passed");
//        }

//        #endregion

//        #region J. ToMemberExpression Tests (3 functions)

//        // Test UnaryExpression conversion to MemberExpression
//        public static void ToMemberExpression_UnaryExpression()
//        {
//            // Create a UnaryExpression that wraps a MemberExpression
//            Expression<Func<Order, object>> expr = o => (object)o.Id;
//            var body = expr.Body as UnaryExpression;
//            Check.Exception(body != null, "ToMemberExpression: UnaryExpression created");
            
//            // Test internal ToMemberExpression method via reflection or usage
//            var memberExpr = body.Operand as MemberExpression;
//            Check.Exception(memberExpr != null, "ToMemberExpression: extracts MemberExpression from UnaryExpression");
//            Console.WriteLine("✓ ToMemberExpression_UnaryExpression passed");
//        }

//        // Test direct MemberExpression passthrough
//        public static void ToMemberExpression_DirectMember()
//        {
//            Expression<Func<Order, int>> expr = o => o.Id;
//            var memberExpr = expr.Body as MemberExpression;
//            Check.Exception(memberExpr != null, "ToMemberExpression: direct MemberExpression");
//            Check.Exception(memberExpr.Member.Name == "Id", "ToMemberExpression: correct member name");
//            Console.WriteLine("✓ ToMemberExpression_DirectMember passed");
//        }

//        // Test null or invalid expression handling
//        public static void ToMemberExpression_InvalidExpression()
//        {
//            Expression<Func<Order, int>> constantExpr = o => 5;
//            var body = constantExpr.Body;
//            Check.Exception(body is ConstantExpression, "ToMemberExpression: ConstantExpression not a MemberExpression");
//            Console.WriteLine("✓ ToMemberExpression_InvalidExpression passed");
//        }

//        #endregion

//        #region K. Edge Cases & Cultural Tests (5 functions)
//        // Tests culture-specific formatting, thread safety, extreme values, and performance

//        /// <summary>
//        /// Validates number parsing works correctly across different cultures
//        /// Tests: invariant culture (period decimal separator), standard parsing
//        /// </summary>
//        public static void Cultural_NumberFormats()
//        {
//            var currentCulture = Thread.CurrentThread.CurrentCulture;
//            try
//            {
//                // Test with invariant culture (period as decimal separator)
//                Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
//                Check.Exception("1234.56".ObjToDecimal() == 1234.56m, "Cultural: invariant culture decimal");
                
//                // Test standard parsing works
//                Check.Exception("999.99".ObjToMoney() == 999.99, "Cultural: standard money parsing");
                
//                Console.WriteLine("✓ Cultural_NumberFormats passed");
//            }
//            finally
//            {
//                Thread.CurrentThread.CurrentCulture = currentCulture;
//            }
//        }

//        /// <summary>
//        /// Validates date parsing works correctly across different cultures
//        /// Tests: US culture (M/d/yyyy), ISO format (yyyy-MM-dd) universal parsing
//        /// </summary>
//        public static void Cultural_DateFormats()
//        {
//            var currentCulture = Thread.CurrentThread.CurrentCulture;
//            try
//            {
//                // Set to US culture: month/day/year format
//                Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
//                var result1 = "1/15/2024".ObjToDate();
//                Check.Exception(result1.Year == 2024 && result1.Month == 1, "Cultural: US date format");
                
//                // ISO format should work regardless of culture
//                var result2 = "2024-01-15".ObjToDate();
//                Check.Exception(result2.Year == 2024, "Cultural: ISO format universal");
                
//                Console.WriteLine("✓ Cultural_DateFormats passed");
//            }
//            finally
//            {
//                // Always restore original culture
//                Thread.CurrentThread.CurrentCulture = currentCulture;
//            }
//        }

//        /// <summary>
//        /// Validates conversion methods are thread-safe for concurrent operations
//        /// Tests: 10 parallel tasks performing multiple conversions simultaneously
//        /// </summary>
//        public static void EdgeCase_ThreadSafety()
//        {
//            var tasks = new Task[10];
//            var success = true;
            
//            // Create 10 parallel tasks
//            for (int i = 0; i < 10; i++)
//            {
//                int index = i;
//                tasks[i] = Task.Run(() =>
//                {
//                    try
//                    {
//                        // Each task performs multiple conversions
//                        var intResult = "123".ObjToInt();
//                        var longResult = "456789".ObjToLong();
//                        var decimalResult = "123.45".ObjToDecimal();
//                        var dateResult = "2024-01-15".ObjToDate();
//                        var boolResult = "true".ObjToBool();
                        
//                        // Validate all conversions succeeded correctly
//                        if (intResult != 123 || longResult != 456789 || decimalResult != 123.45m || 
//                            dateResult.Year != 2024 || boolResult != true)
//                        {
//                            success = false;
//                        }
//                    }
//                    catch
//                    {
//                        success = false;
//                    }
//                });
//            }
            
//            // Wait for all tasks to complete
//            Task.WaitAll(tasks);
//            Check.Exception(success, "EdgeCase: thread-safe conversions");
//            Console.WriteLine("✓ EdgeCase_ThreadSafety passed");
//        }

//        /// <summary>
//        /// Validates conversion methods handle extreme boundary values correctly
//        /// Tests: MaxValue and MinValue for int, long, decimal, and DateTime types
//        /// </summary>
//        public static void EdgeCase_ExtremeValues()
//        {
//            // Int32 boundary values
//            Check.Exception(((object)int.MaxValue).ObjToInt() == int.MaxValue, "EdgeCase: int.MaxValue");
//            Check.Exception(((object)int.MinValue).ObjToInt() == int.MinValue, "EdgeCase: int.MinValue");
            
//            // Int64 boundary values
//            Check.Exception(((object)long.MaxValue).ObjToLong() == long.MaxValue, "EdgeCase: long.MaxValue");
//            Check.Exception(((object)long.MinValue).ObjToLong() == long.MinValue, "EdgeCase: long.MinValue");
            
//            // Decimal boundary values (highest precision)
//            Check.Exception(((object)decimal.MaxValue).ObjToDecimal() == decimal.MaxValue, "EdgeCase: decimal.MaxValue");
//            Check.Exception(((object)decimal.MinValue).ObjToDecimal() == decimal.MinValue, "EdgeCase: decimal.MinValue");
            
//            // DateTime boundary values (year 1 to 9999)
//            Check.Exception(((object)DateTime.MinValue).ObjToDate() == DateTime.MinValue, "EdgeCase: DateTime.MinValue");
//            Check.Exception(((object)DateTime.MaxValue).ObjToDate() == DateTime.MaxValue, "EdgeCase: DateTime.MaxValue");
            
//            Console.WriteLine("✓ EdgeCase_ExtremeValues passed");
//        }

//        /// <summary>
//        /// Validates conversion methods perform efficiently under load
//        /// Tests: 10,000 iterations of 5 different conversion types (50k total conversions)
//        /// Expected: Complete in under 5 seconds
//        /// </summary>
//        public static void EdgeCase_Performance()
//        {
//            var sw = System.Diagnostics.Stopwatch.StartNew();
            
//            // Perform 10,000 iterations of mixed conversions
//            for (int i = 0; i < 10000; i++)
//            {
//                var intResult = "123".ObjToInt();           // String to int
//                var longResult = "456789".ObjToLong();      // String to long
//                var decimalResult = "123.45".ObjToDecimal(); // String to decimal
//                var moneyResult = "99.99".ObjToMoney();     // String to double
//                var stringResult = ((object)123).ObjToString(); // Int to string
//            }
            
//            sw.Stop();
            
//            // Validate performance is acceptable (< 5 seconds for 50k conversions)
//            Check.Exception(sw.ElapsedMilliseconds < 5000, $"EdgeCase: performance acceptable ({sw.ElapsedMilliseconds}ms for 10k conversions)");
//            Console.WriteLine($"✓ EdgeCase_Performance passed ({sw.ElapsedMilliseconds}ms for 50k conversions)");
//        }

//        #endregion
//    }
//}

